//
//  MLTBusinessListTableViewCell.m
//  MotherLover
//
//  Created by lanou on 16/1/12.
//  Copyright © 2016年 zj. All rights reserved.
//

#import "MLTBusinessListTableViewCell.h"

@implementation MLTBusinessListTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addSubviews];
    }
    return self;
}

- (void)addSubviews
{
    //图片
    _photoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, KW / 4, KW / 4 * 200 / 267)];
    _photoImageView.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_photoImageView];
    
    //商店名
    _nameLable = [[UILabel alloc] initWithFrame:CGRectMake(_photoImageView.right + 5, _photoImageView.top, KW - 15 - _photoImageView.frame.size.width, 20)];
    _nameLable.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:_nameLable];
    
    //星级
    _ratingImageView = [[UIImageView alloc] initWithFrame:CGRectMake(_nameLable.left, _nameLable.bottom + 5, _photoImageView.frame.size.height, 20)];
    _ratingImageView.backgroundColor = [UIColor brownColor];
    [self.contentView addSubview:_ratingImageView];
    
    //平均价格
    _priceLable = [[UILabel alloc] initWithFrame:CGRectMake(_ratingImageView.left, _ratingImageView.bottom + 5, _photoImageView.frame.size.width, 20)];
    _priceLable.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:_priceLable];
    
    /*
    
    //地址
    _addressButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _addressButton.backgroundColor = [UIColor lightGrayColor];
    _addressButton.tag = 1;
    _addressButton.alpha = 0.5;
    _addressButton.frame = CGRectMake(KW, 5, 100, 70);
    [self.contentView addSubview:_addressButton];

    
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:2];
    
    _addressButton.frame = CGRectMake(KW - 100, 5, 100, 70);
    
    [UIView commitAnimations];
    */
    
}











- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
